package com.bookyourtrek.action;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Map;

import com.bookyourtrek.model.DashBoardModel;
import com.bookyourtrek.model.SearchListPojo;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class UserDashboardAction extends ActionSupport{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private ArrayList<SearchListPojo> searchlist = new ArrayList<SearchListPojo>();	
	

	public ArrayList<SearchListPojo> getSearchlist() {
		return searchlist;
	}


	public void setSearchlist(ArrayList<SearchListPojo> searchlist) {
		this.searchlist = searchlist;
	}


	@SuppressWarnings("rawtypes")
	public String userdashboard() {
		Map sess=ActionContext.getContext().getSession();
		BigInteger userid = (BigInteger) sess.get("userid");
		
		DashBoardModel dbm = new DashBoardModel();
		searchlist = dbm.getalltrekbyuser(userid);
		
		return SUCCESS;
	}
}
